package com.lmiot.xyclick.Activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.lmiot.xyclick.Util.SpFlag;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Util.LogUtil;
import com.youyi.yyviewsdklibrary.LoadingDialog;
import com.youyi.yyviewsdklibrary.View.TitleBarView;

public class WebViewActivity extends AppCompatActivity {
    TitleBarView mIdTitleBar;
    private String mUrl;
    WebView mWebView;

    /* access modifiers changed from: protected */
    @Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.SupportActivity, android.support.v4.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_webview);
        initView();
        String stringExtra = getIntent().getStringExtra(SpFlag.k);
        String stringExtra2 = getIntent().getStringExtra("url");
        this.mUrl = stringExtra2;
        LogUtil.d("WebViewActivity", stringExtra2);
        this.mIdTitleBar.setTitle(stringExtra);
        this.mIdTitleBar.setOnItemClickListener(new TitleBarView.onItemClickListener() {
            /* class com.lmiot.xyclick.Activity.WebViewActivity.AnonymousClass1 */

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onMenuClick(View view) {
            }

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onTitleClick(View view) {
            }

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onBackClick(View view) {
                if (WebViewActivity.this.mWebView.canGoBack()) {
                    WebViewActivity.this.mWebView.goBack();
                } else {
                    WebViewActivity.this.finish();
                }
            }
        });
        LoadingDialog.show(this, LoadingDialog.DialogType.CENTER, true, "");
        this.mWebView.getSettings().setJavaScriptEnabled(true);
        this.mWebView.setWebViewClient(new WebViewClient() {
            /* class com.lmiot.xyclick.Activity.WebViewActivity.AnonymousClass2 */

            @Override // android.webkit.WebViewClient
            public boolean shouldOverrideUrlLoading(WebView webView, String str) {
                webView.loadUrl(str);
                return true;
            }

            public void onPageFinished(WebView webView, String str) {
                super.onPageFinished(webView, str);
                LoadingDialog.hidden();
            }
        });
        this.mWebView.loadUrl(this.mUrl);
    }

    private void initView() {
        this.mIdTitleBar = (TitleBarView) findViewById(R.id.id_title_bar);
        this.mWebView = (WebView) findViewById(R.id.webView);
    }
}
